refactor: dispatch visualize_combined per Visualizer type in FactorGraphModel#1340
Merged
Conversation
FactorGraphModel.visualize_combined (and perform_quick_update) routed EVERY factor into the lead factor's Visualizer.visualize_combined, which breaks mixed-dataset graphs — the first one (AnalysisImaging + AnalysisWeak, the weak series' combined strong+weak example) crashed until PyAutoLens's visualizers grew type filters (PyAutoLabs/PyAutoLens#587). Fix the producer: group (factor, instance) pairs by the analysis Visualizer class (order preserved) and issue one combined call per group. Homogeneous graphs produce exactly one group — byte-identical to the previous behaviour. The PyAutoLens filters remain as defence in depth. Closes #1339. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
FactorGraphModel.visualize_combined/perform_quick_updaterouted every factor into the lead factor'sVisualizer.visualize_combined, crashing mixed-dataset graphs (first hit by AnalysisImaging + AnalysisWeak in the weak series; PyAutoLens papered over it with type filters in PyAutoLabs/PyAutoLens#587). This fixes the producer: factors group by their analysisVisualizerclass (order preserved) and each group gets one combined call with its matching sub-instances. Homogeneous graphs form a single group — byte-identical previous behaviour. Closes #1339.API Changes
None — internal dispatch; the public visualize surface is unchanged.
Test Plan
test_visualize_combined_dispatch.py: homogeneous graph = one call with all factors/instances; mixed graph = one call per visualizer type with order-preserved sub-lists.test_autofit/: 1424 passed, 14 skipped.Validation checklist (--auto run)
🤖 Generated with Claude Code